package com.example.xyr.myapplication

import android.app.Application
import android.support.multidex.MultiDexApplication
import cn.jpush.im.android.api.JMessageClient
import com.example.xyr.myapplication.ui.im.GlobalEventListener
import com.example.xyr.myapplication.utils.MyIntent
import com.jrmf360.tools.JrmfClient
import com.jrmf360.tools.utils.LogUtil
import org.litepal.LitePal

/**
 * Created by ylcf on 2018/8/21.
 */
class MyApp : MultiDexApplication() {

    companion object {
        lateinit var myapp: Application
        lateinit var userId: String
        lateinit var token: String
    }

    override fun onCreate() {
        super.onCreate()
        myapp = this
        JMessageClient.setDebugMode(true)
        JMessageClient.init(this)
        //        红包
        //        JrmfClient.init(this, "hbcl180601", "小依然");
        JrmfClient.init(this, "closedbate", "小依然")
        JrmfClient.isDebug(true)
        LogUtil.init(true)
        //注册全局事件监听类
        JMessageClient.registerEventReceiver(GlobalEventListener(myapp))
        //数据库初始化
        LitePal.initialize(this)
        MyIntent.init(this)
    }
}